Optimal. Leaf size=123 \[ -\frac {2 (c+d x)^2 \tanh ^{-1}\left (e^{i (a+b x)}\right )}{b}+\frac {2 i d (c+d x) \text {Li}_2\left (-e^{i (a+b x)}\right )}{b^2}-\frac {2 i d (c+d x) \text {Li}_2\left (e^{i (a+b x)}\right )}{b^2}-\frac {2 d^2 \text {Li}_3\left (-e^{i (a+b x)}\right )}{b^3}+\frac {2 d^2 \text {Li}_3\left (e^{i (a+b x)}\right )}{b^3} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 123, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 4, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {4268, 2611,
2320, 6724} \begin {gather*} -\frac {2 d^2 \text {PolyLog}\left (3,-e^{i (a+b x)}\right )}{b^3}+\frac {2 d^2 \text {PolyLog}\left (3,e^{i (a+b x)}\right )}{b^3}+\frac {2 i d (c+d x) \text {PolyLog}\left (2,-e^{i (a+b x)}\right )}{b^2}-\frac {2 i d (c+d x) \text {PolyLog}\left (2,e^{i (a+b x)}\right )}{b^2}-\frac {2 (c+d x)^2 \tanh ^{-1}\left (e^{i (a+b x)}\right )}{b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2320
Rule 2611
Rule 4268
Rule 6724
Rubi steps
\begin {align*} \int (c+d x)^2 \csc (a+b x) \, dx &=-\frac {2 (c+d x)^2 \tanh ^{-1}\left (e^{i (a+b x)}\right )}{b}-\frac {(2 d) \int (c+d x) \log \left (1-e^{i (a+b x)}\right ) \, dx}{b}+\frac {(2 d) \int (c+d x) \log \left (1+e^{i (a+b x)}\right ) \, dx}{b}\\ &=-\frac {2 (c+d x)^2 \tanh ^{-1}\left (e^{i (a+b x)}\right )}{b}+\frac {2 i d (c+d x) \text {Li}_2\left (-e^{i (a+b x)}\right )}{b^2}-\frac {2 i d (c+d x) \text {Li}_2\left (e^{i (a+b x)}\right )}{b^2}-\frac {\left (2 i d^2\right ) \int \text {Li}_2\left (-e^{i (a+b x)}\right ) \, dx}{b^2}+\frac {\left (2 i d^2\right ) \int \text {Li}_2\left (e^{i (a+b x)}\right ) \, dx}{b^2}\\ &=-\frac {2 (c+d x)^2 \tanh ^{-1}\left (e^{i (a+b x)}\right )}{b}+\frac {2 i d (c+d x) \text {Li}_2\left (-e^{i (a+b x)}\right )}{b^2}-\frac {2 i d (c+d x) \text {Li}_2\left (e^{i (a+b x)}\right )}{b^2}-\frac {\left (2 d^2\right ) \text {Subst}\left (\int \frac {\text {Li}_2(-x)}{x} \, dx,x,e^{i (a+b x)}\right )}{b^3}+\frac {\left (2 d^2\right ) \text {Subst}\left (\int \frac {\text {Li}_2(x)}{x} \, dx,x,e^{i (a+b x)}\right )}{b^3}\\ &=-\frac {2 (c+d x)^2 \tanh ^{-1}\left (e^{i (a+b x)}\right )}{b}+\frac {2 i d (c+d x) \text {Li}_2\left (-e^{i (a+b x)}\right )}{b^2}-\frac {2 i d (c+d x) \text {Li}_2\left (e^{i (a+b x)}\right )}{b^2}-\frac {2 d^2 \text {Li}_3\left (-e^{i (a+b x)}\right )}{b^3}+\frac {2 d^2 \text {Li}_3\left (e^{i (a+b x)}\right )}{b^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.19, size = 210, normalized size = 1.71 \begin {gather*} \frac {-2 b^2 c^2 \tanh ^{-1}\left (e^{i (a+b x)}\right )+2 b^2 c d x \log \left (1-e^{i (a+b x)}\right )+b^2 d^2 x^2 \log \left (1-e^{i (a+b x)}\right )-2 b^2 c d x \log \left (1+e^{i (a+b x)}\right )-b^2 d^2 x^2 \log \left (1+e^{i (a+b x)}\right )+2 i b d (c+d x) \text {Li}_2\left (-e^{i (a+b x)}\right )-2 i b d (c+d x) \text {Li}_2\left (e^{i (a+b x)}\right )-2 d^2 \text {Li}_3\left (-e^{i (a+b x)}\right )+2 d^2 \text {Li}_3\left (e^{i (a+b x)}\right )}{b^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 360 vs. \(2 (111 ) = 222\).
time = 0.05, size = 361, normalized size = 2.93
method | result | size |
risch | \(-\frac {2 d^{2} a^{2} \arctanh \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}+\frac {4 c d a \arctanh \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}-\frac {2 i d^{2} \polylog \left (2, {\mathrm e}^{i \left (b x +a \right )}\right ) x}{b^{2}}+\frac {2 i d^{2} \polylog \left (2, -{\mathrm e}^{i \left (b x +a \right )}\right ) x}{b^{2}}-\frac {2 c^{2} \arctanh \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b}-\frac {d^{2} \ln \left ({\mathrm e}^{i \left (b x +a \right )}+1\right ) x^{2}}{b}+\frac {d^{2} \ln \left ({\mathrm e}^{i \left (b x +a \right )}+1\right ) a^{2}}{b^{3}}+\frac {2 i c d \polylog \left (2, -{\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}+\frac {2 d^{2} \polylog \left (3, {\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}-\frac {2 d^{2} \polylog \left (3, -{\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}+\frac {d^{2} \ln \left (1-{\mathrm e}^{i \left (b x +a \right )}\right ) x^{2}}{b}-\frac {d^{2} \ln \left (1-{\mathrm e}^{i \left (b x +a \right )}\right ) a^{2}}{b^{3}}-\frac {2 i c d \polylog \left (2, {\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}-\frac {2 c d \ln \left ({\mathrm e}^{i \left (b x +a \right )}+1\right ) x}{b}-\frac {2 c d \ln \left ({\mathrm e}^{i \left (b x +a \right )}+1\right ) a}{b^{2}}+\frac {2 c d \ln \left (1-{\mathrm e}^{i \left (b x +a \right )}\right ) x}{b}+\frac {2 c d \ln \left (1-{\mathrm e}^{i \left (b x +a \right )}\right ) a}{b^{2}}\) | \(361\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 398 vs. \(2 (107) = 214\).
time = 0.36, size = 398, normalized size = 3.24 \begin {gather*} -\frac {2 \, c^{2} \log \left (\cot \left (b x + a\right ) + \csc \left (b x + a\right )\right ) - \frac {4 \, a c d \log \left (\cot \left (b x + a\right ) + \csc \left (b x + a\right )\right )}{b} + \frac {2 \, a^{2} d^{2} \log \left (\cot \left (b x + a\right ) + \csc \left (b x + a\right )\right )}{b^{2}} + \frac {4 \, d^{2} {\rm Li}_{3}(-e^{\left (i \, b x + i \, a\right )}) - 4 \, d^{2} {\rm Li}_{3}(e^{\left (i \, b x + i \, a\right )}) - 2 \, {\left (-i \, {\left (b x + a\right )}^{2} d^{2} + 2 \, {\left (-i \, b c d + i \, a d^{2}\right )} {\left (b x + a\right )}\right )} \arctan \left (\sin \left (b x + a\right ), \cos \left (b x + a\right ) + 1\right ) - 2 \, {\left (-i \, {\left (b x + a\right )}^{2} d^{2} + 2 \, {\left (-i \, b c d + i \, a d^{2}\right )} {\left (b x + a\right )}\right )} \arctan \left (\sin \left (b x + a\right ), -\cos \left (b x + a\right ) + 1\right ) - 4 \, {\left (i \, b c d + i \, {\left (b x + a\right )} d^{2} - i \, a d^{2}\right )} {\rm Li}_2\left (-e^{\left (i \, b x + i \, a\right )}\right ) - 4 \, {\left (-i \, b c d - i \, {\left (b x + a\right )} d^{2} + i \, a d^{2}\right )} {\rm Li}_2\left (e^{\left (i \, b x + i \, a\right )}\right ) + {\left ({\left (b x + a\right )}^{2} d^{2} + 2 \, {\left (b c d - a d^{2}\right )} {\left (b x + a\right )}\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} + 2 \, \cos \left (b x + a\right ) + 1\right ) - {\left ({\left (b x + a\right )}^{2} d^{2} + 2 \, {\left (b c d - a d^{2}\right )} {\left (b x + a\right )}\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} - 2 \, \cos \left (b x + a\right ) + 1\right )}{b^{2}}}{2 \, b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 504 vs. \(2 (107) = 214\).
time = 0.37, size = 504, normalized size = 4.10 \begin {gather*} \frac {2 \, d^{2} {\rm polylog}\left (3, \cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) + 2 \, d^{2} {\rm polylog}\left (3, \cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) - 2 \, d^{2} {\rm polylog}\left (3, -\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) - 2 \, d^{2} {\rm polylog}\left (3, -\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) - 2 \, {\left (i \, b d^{2} x + i \, b c d\right )} {\rm Li}_2\left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) - 2 \, {\left (-i \, b d^{2} x - i \, b c d\right )} {\rm Li}_2\left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) - 2 \, {\left (i \, b d^{2} x + i \, b c d\right )} {\rm Li}_2\left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) - 2 \, {\left (-i \, b d^{2} x - i \, b c d\right )} {\rm Li}_2\left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) - {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2}\right )} \log \left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + 1\right ) - {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2}\right )} \log \left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + 1\right ) + {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) + \frac {1}{2} i \, \sin \left (b x + a\right ) + \frac {1}{2}\right ) + {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) - \frac {1}{2} i \, \sin \left (b x + a\right ) + \frac {1}{2}\right ) + {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + 2 \, a b c d - a^{2} d^{2}\right )} \log \left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + 1\right ) + {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + 2 \, a b c d - a^{2} d^{2}\right )} \log \left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + 1\right )}{2 \, b^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (c + d x\right )^{2} \csc {\left (a + b x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\left (c+d\,x\right )}^2}{\sin \left (a+b\,x\right )} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________